<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>学术论文数据库</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <style>
        :root {
            --primary-color: #2c3e50;
            --secondary-color: #6c757d;
            --accent-color: #3498db;
            --card-padding: 2rem;
        }

        body {
            background-color: #f8f9fa;
            font-family: 'Helvetica Neue', Helvetica, Arial, 'PingFang SC', 'Microsoft YaHei', sans-serif;
            padding: 2rem 0;
        }

        .container-wrapper {
            max-width: 1200px;
            margin: 0 auto;
        }

        /* 搜索框样式 */
        .search-header {
            background: white;
            border-radius: 12px;
            padding: 2rem;
            margin-bottom: 3rem;
            box-shadow: 0 4px 20px rgba(0,0,0,0.05);
        }

        .search-label {
            font-size: 1.4rem;
            color: var(--primary-color);
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 1rem;
            margin-bottom: 1rem;
        }

        .search-input {
            border: 2px solid var(--accent-color);
            border-radius: 8px;
            padding: 1rem 1.5rem;
            font-size: 1.1rem;
            transition: all 0.3s ease;
            width: 100%;
        }

        .search-input:focus {
            box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
            outline: none;
        }

        /* 论文卡片样式 */
        .paper-card {
            background: white;
            border-radius: 12px;
            box-shadow: 0 4px 6px rgba(0,0,0,0.05);
            margin-bottom: 2rem;
            padding: var(--card-padding);
            transition: transform 0.3s ease;
        }

        .paper-card:hover {
            transform: translateY(-3px);
        }

        .title-group {
            border-left: 4px solid var(--accent-color);
            padding-left: 1.2rem;
            margin-bottom: 1.5rem;
        }

        .en-title {
            color: var(--primary-color);
            font-size: 1.8rem;
            font-weight: 600;
            margin-bottom: 0.5rem;
        }

        .zh-title {
            color: var(--secondary-color);
            font-size: 1.3rem;
            line-height: 1.4;
        }

        .meta-info {
            color: #666;
            margin: 1.5rem 0;
            display: grid;
            gap: 1rem;
        }

        .meta-item {
            display: flex;
            align-items: center;
            gap: 0.8rem;
            font-size: 16px;
        }

        .meta-title {
            color: var(--accent-color);
            font-weight: 600;
        }

        .author-section {
            display: flex;
            flex-wrap: wrap;
            gap: 0.8rem;
            margin: 1.5rem 0;
        }

        .author-badge {
            background: #e9ecef;
            padding: 0.4rem 1rem;
            border-radius: 20px;
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
        }

        .action-buttons {
            border-top: 1px solid #eee;
            padding-top: 1.5rem;
            margin-top: 1.5rem;
        }

        .link-button {
            background: var(--accent-color);
            color: white !important;
            padding: 0.8rem 1.5rem;
            border-radius: 30px;
            text-decoration: none;
            display: inline-flex;
            align-items: center;
            gap: 0.8rem;
            transition: background 0.3s ease;
        }

        .link-button:hover {
            background: #2980b9;
        }

        @media (max-width: 768px) {
            .en-title {
                font-size: 1.5rem;
            }
            .zh-title {
                font-size: 1.1rem;
            }
            .search-label {
                font-size: 1.2rem;
            }
            .paper-card {
                padding: 1.5rem;
            }
        }
    </style>
</head>
<body>
    <div class="container-wrapper">
        <!-- 搜索区域 -->
        <div class="search-header">
            <div class="search-label">
                <i class="fas fa-search"></i>
                论文检索
            </div>
            <input type="text" 
                   id="searchInput"
                   class="search-input"
                   placeholder="输入中文/英文标题、作者或期刊进行搜索...">
        </div>

        <!-- 论文列表 -->
        <div id="paperList">
            {% for paper in papers %}
            <div class="paper-card" 
                 data-search="{{ paper.title|lower }} {{ paper.title_zh|lower }} {{ paper.author|lower }} {{ paper.source|lower }} {{ paper.created_time|lower }}">
                <div class="title-group">
                    <h2 class="en-title">{{ paper.title }}</h2>
                    <div class="zh-title">{{ paper.title_zh }}</div>
                </div>

                <div class="meta-info">
                    <div class="meta-item">
                        <span class="meta-title">Publication date:</span>
                        <span>{{ paper.publication_date }}</span>
                        
                        <span class="meta-title">Created time:</span>
                        <span>{{ paper.created_time }}</span>
                    </div>
                    <div class="meta-item">
                        <span class="meta-title">Source:</span>
                        <span>{{ paper.source }}</span>
                    </div>
                </div>

                <div class="author-section">
                    {% if paper.author %}
                        {% set authors = paper.author.split(',') %}
                        {% for author in authors %}
                            {% if author.strip() %}
                            <span class="author-badge">
                                <i class="fas fa-user-circle"></i>
                                {{ author.strip() }}
                            </span>
                            {% endif %}
                        {% endfor %}
                    {% else %}
                        <span class="text-muted">作者信息未提供</span>
                    {% endif %}
                </div>

                <div class="action-buttons">
                    <a href="{{ paper.link }}" class="link-button" target="_blank">
                        <i class="fas fa-external-link-alt"></i>
                        阅读全文
                    </a>
                </div>
            </div>
            {% endfor %}
        </div>
    </div>

    <!-- 图标库 -->
    <script src="https://kit.fontawesome.com/your-fontawesome-kit.js"></script>
    
    <!-- 搜索功能 -->
    <script>
        document.getElementById('searchInput').addEventListener('input', function(e) {
            const searchTerm = e.target.value.toLowerCase().trim();
            const papers = document.querySelectorAll('.paper-card');
            
            papers.forEach(paper => {
                const searchData = paper.dataset.search;
                const match = searchData.includes(searchTerm);
                paper.style.display = match ? 'block' : 'none';
            });
        });
    </script>
</body>
</html>